/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mmf.minotor.semantictypes.ui;

import java.util.ArrayList;
import java.util.List;

/**
 * Based on sneps3
 * 
 * @author clayton
 */
public class SemanticType
{
    List<SemanticType> parents = new ArrayList<SemanticType>();
    String name;

    public SemanticType(String name, List<SemanticType> parents)
    {
        this.name = name;
        this.parents = parents;
    }

    public List<SemanticType> getParent()
    {
        return parents;
    }

    public boolean hasParent(SemanticType p)
    {
        for (SemanticType parent : parents)
        {
            if (parent == p || parent.hasParent(p))
            {
                return true;
            }
        }
        return false;
    }

    public String getName()
    {
        return name;
    }

    @Override
    public String toString()
    {
        return name;
    }
}
